<template>
	<view class="">
		<!-- 头部 -->
		<pagehead>
			互转
			<!-- #ifdef	H5 || APP-PLUS -->
			<view class="header-right" @tap.stop="$tools.jump('/pages/asset/transferlog',cashType)">互转记录</view>
			<!-- #endif -->
		</pagehead>
		<view class="form-warp">
			<view class="form-box">
				<view class="form-item">
					<view class="form-item-label">
						互转账号
					</view>
					<u--input class="form-item-inner" placeholder="请输入互转账号" type="number"
						customStyle="marginLeft:40rpx;marginRight:40rpx;" border="none" v-model="form.phone">
					</u--input>
				</view>
				<view class="form-item">
					<view class="form-item-label">
						互转数量
					</view>
					<u--input class="form-item-inner" placeholder="请输入互转数量" type="number"
						customStyle="marginLeft:40rpx;marginRight:40rpx;" border="none" v-model="form.num">
					</u--input>
				</view>
				<view class="form-item">
					<view class="form-item-label">
						支付密码
					</view>
					<u--input class="form-item-inner" placeholder="请输入支付密码" type="password"
						customStyle="marginLeft:40rpx;marginRight:40rpx;" border="none" v-model="form.password">
					</u--input>
				</view>
			</view>
			<view class="submit" @tap.stop="submit()">
				确定
			</view>
		</view>
		<!-- #ifdef MP-WEIXIN -->
		<view class="text-center" @tap.stop="$tools.jump('/pages/asset/transferlog',cashType)">
		<text>互转记录</text></view>
		<!-- #endif -->
	</view>
</template>

<script>
export default {
	data() {
		return {
			time: 60,
			form: {
				password:'',
				rePassword:'',
				tuCode: '',
				code: '',
			},
			cashType:'',
			userInfo: uni.getStorageSync('usermsg') ? uni.getStorageSync('usermsg') : {}
		};
	},
	onLoad() {
		if(options){
			this.cashType = options.value1
		}
	},
	methods: {
		submit() {
			let that = this;
			if (!that.form.phone) {
				return that.$tools.toast('请输入互转账号');
			}
			if (!that.form.num) {
				return that.$tools.toast('请输入互转数量');
			}
			if (!that.form.password) {
				return that.$tools.toast('请输入支付密码');
			}
			let data = {
				pay_password: that.$md5(that.form.password),
				in_user_account: that.form.phone,
				roll_num: that.form.num,
				roll_type: '03',
			}
			console.log('data',data)
			that.$Ajax('/api/wallet/roll/userApplyRoll', data, res => {
				if (res.success) {
					that.$tools.toastBack(res.msg, 1);
					that.$tools.toastJump('提交成功','/pages/asset/transferlog',this.cashType)
				}
			})
		},
	},
};
</script>

<style lang="scss" scoped>
@import '@/common/scss/operate';
.header-right {
    position: absolute;
    font-size: 14px;
    right: 15px;
    top: 0;
    color: #152133;
    display: flex;
    align-items: center;
    justify-content: flex-end;
}
.text-center{
	margin-top: 62rpx;
	font-size: 28rpx;
	color: #333333;
	line-height: 48rpx;
	text-align: center;
	text{
		border-bottom: 1px solid #AEAEAE;
	}
}
</style>
